<div ng-include="'components/navbar/navbar.html'"></div>

<div class="container">
  <div class="col-md-12">
    <h1 class="page-header">Dashboard</h1>
  </div>
  <div class="col-md-8">
    <div class="table-responsive" ng-if="meetings.length">
      <table class="table">
        <thead>
        <tr>
          <th>#</th>
          <th>名称</th>
          <th>会议规模</th>
          <th>实到人数</th>
          <th>会议日期</th>
          <th>创建日期</th>
          <th>会议状态</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="meeting in meetings">
          <td>{{ ($index + 1) }}</td>
          <td><a ui-sref="admin.meeting-detail({meetingId: meeting._id})">{{meeting.name}}</a></td>
          <td>{{meeting.size}} 人</td>
          <td>{{meeting.actual_size}} 人</td>
          <td>{{meeting.date | date: 'yyyy-MM-dd'}}</td>
          <td>{{meeting.meta.created_at | date: 'yyyy-MM-dd'}}</td>
          <td ng-switch="meeting.status">
            <span ng-switch-when="done" class="label label-primary">已完成</span>
            <span ng-switch-when="wait" class="label label-default">未开始</span>
            <span ng-switch-when="progress" class="label label-success">进行中</span>
            <span ng-switch-when="expired" class="label label-warning">已过期</span>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
    <div ng-if="!meetings.length">
      <p class="lead">没有任何会议</p>
    </div>
  </div>
  <div class="col-md-3 col-md-offset-1">
    <button class="btn btn-primary" ui-sref="admin.meeting-add">添加新的会议</button>
  </div>
</div>
